﻿namespace Borg
{
    public class SlotTypePropertyInfo
    {
        private readonly SlotTypeInfo _slotType;

        public bool AutoOpen
        {
            get { return _slotType.slotAttribute.AutoOpen; }
            set
            {
                if (AutoOpen == value)
                    return;

                _slotType.slotAttribute.AutoOpen = value;
                _slotType.OnPropertyChanged("AutoOpen");
            }
        }

        public bool AutoRegister
        {
            get { return _slotType.slotAttribute.AutoRegister; }
            set
            {
                if (AutoRegister == value)
                    return;

                _slotType.slotAttribute.AutoRegister = value;
                _slotType.OnPropertyChanged("AutoRegister");
            }
        }

        public bool AutoPlug
        {
            get { return _slotType.slotAttribute.AutoPlug; }
            set
            {
                if (AutoPlug == value)
                    return;

                _slotType.slotAttribute.AutoPlug = value;
                _slotType.OnPropertyChanged("AutoPlug");
            }
        }

        public bool LazyLoad
        {
            get { return _slotType.slotAttribute.LazyLoad; }
            set
            {
                if (LazyLoad == value)
                    return;

                _slotType.slotAttribute.LazyLoad = value;
                _slotType.OnPropertyChanged("LazyLoad");
            }
        }

        public bool Multiple
        {
            get { return _slotType.slotAttribute.Multiple; }
            set
            {
                if (Multiple == value)
                    return;

                _slotType.slotAttribute.Multiple = value;
                _slotType.OnPropertyChanged("Multiple");
            }
        }

        public bool Unique
        {
            get { return _slotType.slotAttribute.Unique; }
            set
            {
                if (Unique == value)
                    return;

                _slotType.slotAttribute.Unique = value;
                _slotType.OnPropertyChanged("Unique");
            }
        }

        public bool AutoRelease
        {
            get { return _slotType.slotAttribute.AutoRelease; }
            set
            {
                if (AutoRelease == value)
                    return;

                _slotType.slotAttribute.AutoRelease = value;
                _slotType.OnPropertyChanged("AutoRelease");
            }
        }

        public SelectionMode SelectionMode
        {
            get { return _slotType.slotAttribute.SelectionMode; }
            set
            {
                if (SelectionMode == value)
                    return;

                _slotType.slotAttribute.SelectionMode = value;
                _slotType.OnPropertyChanged("SelectionMode");
            }
        }

        public SlotTypePropertyInfo(SlotTypeInfo slotType)
        {
            _slotType = slotType;
        }
    }
}

